<?php

namespace App\ModelFilters;


class CzOrderFilter extends BaseFilter
{
    /**
     * Related Models that have ModelFilters as well as the method on the ModelFilter
     * As [relationMethod => [input_key1, input_key2]].
     *
     * @var array
     */
    public $relations = [];

    public function timeout($value)
    {
        return $this->where('created_at', '<=',  time() - $value);
    }
    public function pay_id($value)
    {
        return $this->where('pay_id', $value);
    }
    public function openid($value)
    {
        return $this->where('openid', $value);
    }
    public function pay_type($pay_type)
    {
        return $this->where('pay_type', $pay_type);
    }
    public function order_sn($value)
    {
        $arr = explode(" ", $value);
        return $this->whereIn('order_sn', $arr);
    }
    public function pay_status($value)
    {
        return $this->where('pay_status', $value);
    }
    public function refund_status($value)
    {
        return $this->where('refund_status', $value);
    }
    public function user_order_sn($value)
    {
        return $this->where('user_order_sn', $value);
    }
    public function batch_order_sn($value)
    {
        return $this->where('batch_order_sn', $value);
    }
    public function mobile($value)
    {
        $mobileArr = explode(" ", $value);
        return $this->whereIn('mobile', $mobileArr);
    }
    public function face_value($value)
    {
        return $this->where('face_value', $value);
    }
    public function province_id($value)
    {
        return $this->where('province_id', $value);
    }
    public function city_id($value)
    {
        return $this->where('city_id', $value);
    }
    public function order_status($value)
    {
        return $this->where('order_status', $value);
    }
    public function order_status_in($value)
    {
        return $this->whereIn('order_status', $value);
    }
    public function isp($value)
    {
        return $this->where('isp', $value);
    }
    public function biz_type($value)
    {
        return $this->where('biz_type', $value);
    }
    public function hf_type($value)
    {
        return $this->where('hf_type', $value);
    }
    public function product_id($value)
    {
        return $this->where('product_id', $value);
    }
    public function product_ids($value)
    {
        return $this->whereIn('product_id', $value);
    }
    public function spec_id($value)
    {
        return $this->where('spec_id', $value);
    }
    public function channel_id($value)
    {
        return $this->where('channel_id', $value);
    }
    public function is_loop($value)
    {
        return $this->where('is_loop', $value);
    }

    public function user_id($value)
    {
        return $this->where('create_by', $value);
    }
    public function submit_from($value)
    {
        return $this->where('submit_from', $value);
    }
    public function is_auto($value)
    {
        return $this->where('is_auto', $value);
    }
    public function oid($value)
    {
        return $this->where('id', '<=', $value);
    }
}
